<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 导入 layui 样式 -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <!-- 裁剪图片的css -->
    <link rel="stylesheet" href="/assets/lib/cropper/cropper.css">
    <!-- 导入 user-pub css -->
    <link rel="stylesheet" href="/assets/css/article/article-pub.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">发布文章</div>
        <div class="layui-card-body">
            <form class="layui-form" id="pub-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">文章标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" class="layui-input" placeholder="请入文章标题">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">文章类别</label>
                    <div class="layui-input-block">
                        <select name="cate_id"></select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">文章内容</label>
                    <div class="layui-input-block">
                        <textarea name="content" style="height: 400px;"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">文章封面</label>
                    <div class="layui-input-block cover-box">
                        <div class="left-cover">
                            <img id="cover" src="/assets/images/avatar.jpg" alt="">
                        </div>
                        <div class="right-cover">
                            <div class="preview-cover"></div>
                            <!-- 隐藏的文本框 -->
                            <input type="file" id="file" hidden>
                            <button type="button" class="layui-btn layui-btn-danger" id="select-file">选择封面</button>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit>发布</button>
                        <button class="layui-btn layui-btn-primary" id="save">保存草稿</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script type="text/html" id="tpl-cate">
        <option value="">所有分类</option>
        {{each data item}}
        <option value="{{item.Id}}">{{item.name}}</option>
        {{/each}}
    </script>
    <!-- 导入layui js -->
    <script src="/assets/lib/layui/layui.all.js"></script>

    <!-- 导入 jQuery -->
    <script src="/assets/lib/jquery.js"></script>

    <!-- 导入富文本插件 -->
    <script src="/assets/lib/tinymce/tinymce.min.js"></script>
    <script src="/assets/lib/tinymce/tinymce_setup.js"></script>
    <!-- 裁剪图片 -->
    <script src="/assets/lib/cropper/Cropper.js"></script>
    <script src="/assets/lib/cropper/jquery-cropper.js"></script>
    <!-- 模板引擎 -->
    <script src="/assets/lib/template-web.js"></script>
    <!-- 导入配置 -->
    <script src="/assets/js/BASE_API.js"></script>
    <!-- 导入 article-pub js -->
    <script src="/assets/js/article/article-pub.js"></script>

</body>

</html>